<template>
  <div class="connect-device" v-if="isConnectDevice">
    <Alert  severity="success" :text="text" />
  </div>
</template>

<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';
import Alert from '@/components/alert';

@Component({
  components: {
    Alert
  }
})
export default class ConnectDevice extends Vue {
  // private text = '未关联设备';

  get equipment() {
    return this.$store.state.equipment;
  }

  get isConnectDevice() {
    return this.equipment && this.equipment.deviceName ? true : false
  }

  get text() {
    return this.isConnectDevice ? `${this.equipment.siteName}${this.equipment.deviceName}` : '未关联设备';
  }

}
</script>
